﻿using System;
using System.Threading;
using System.Threading.Tasks;

using CommonLib;
using Hik.Communication.Scs.Client;
using Hik.Communication.Scs.Communication.EndPoints.Tcp;
using Hik.Communication.Scs.Communication.Messages;

/* This application is build to demonstrate a CUSTOM WIRE PROTOCOL usage with SCS framework.
 * This client application connects to a server and sends a message using MyWireProtocol class.
 */

namespace ClientApp
{
    class Program
    {
        static int count = 1;
        static void Main()
        {
            Console.WriteLine("Press enter to connect to server and say Hello world!");
            Console.ReadLine();

            //LinqToSqlPerformaceTest objLinqToSql = new LinqToSqlPerformaceTest();
            //objLinqToSql.Run();

            NormalClient objNormalClient = new NormalClient(1);
            objNormalClient.Run();
            //objNormalClient.RunWithTimer(100);

            //DuplexClientCustomProtocol.Run();
            Console.WriteLine("Press enter to disconnect from server");
            Console.ReadLine();
        }

        static void Start()
        {
            NormalClient objNormalClient = new NormalClient(count);
            objNormalClient.Run();
        }
        static void StartWithThreads()
        {
            for (int i = 0; i < 10; i++)
            {
                count = i + 1;
                Thread t = new Thread(Start);
                t.Start();
            }
        }
    }
}
